package com.stylefeng.guns.common.persistence.model;

import java.io.Serializable;

import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.NotBlank;

import javax.validation.constraints.NotNull;

/**
 * <p>
 * lg_题库
 * </p>
 *
 * @author xin123
 * @since 2018-01-30
 */
@TableName("lg_question")
public class Question extends Model<Question> {

    private static final long serialVersionUID = 1L;

    /**
     * id
     */
    private Integer id;
    /**
     * 分类
     */
    private Integer categoryid;
    /**
     * 题目信息
     */
    @Length(min = 1, max = 5000, message = "题目信息字数必须在1到5000之间")
    @NotBlank(message="题目信息不能为空")
    private String info;
    /**
     * 难易度
     */
    @NotNull(message="难易度不能为空")
    private Integer degree;
    /**
     * 备注
     */
    private String remarks;
    /**
     * 出题人
     */
    private Integer author;


    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public Integer getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(Integer categoryid) {
        this.categoryid = categoryid;
    }

    public String getInfo() {
        return info;
    }

    public void setInfo(String info) {
        this.info = info;
    }

    public Integer getDegree() {
        return degree;
    }

    public void setDegree(Integer degree) {
        this.degree = degree;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public Integer getAuthor() {
        return author;
    }

    public void setAuthor(Integer author) {
        this.author = author;
    }

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "Question{" +
        "id=" + id +
        ", categoryid=" + categoryid +
        ", info=" + info +
        ", degree=" + degree +
        ", remarks=" + remarks +
        ", author=" + author +
        "}";
    }
}
